package com.zhai.infrastructure.persistent.po;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Description: 用户活动账户-日
 * @ClassName: RaffleActivityAccountDay
 * @Author: zhaiyongxin
 * @Date: 2025/2/27 11:50
 * @Version: 1.0
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RaffleActivityAccountDay {
    private final SimpleDateFormat dateFormatDay = new SimpleDateFormat("yyyy-MM-dd");
    /** 自增ID*/
    private Long id;
    /** 用户ID*/
    private String userId;
    /** 活动ID*/
    private Long activityId;
    /** 日期（yyyy-mm-dd）*/
    private String day;
    /** 日次数*/
    private Integer dayCount;
    /** 日次数-剩余*/
    private Integer dayCountSurplus;
    /** 创建时间*/
    private Date createTime;
    /** 更新时间*/
    private Date updateTime;

    public String currentDay() {
        return dateFormatDay.format(new Date());
    }
}
